package gui_classes;

import java.awt.*;

import javax.swing.*;

import domain.*;

public class ViewPatientPage extends DERPBase {
	
	private Patient pat;
	private UsersPagePanel userinfo;
	private PatientsPagePanel userinfo2;
	private ViewingPatientPanel vpanel;
	
	private DERPBase callingPage;

	/**
	 * Create the panel.
	 */
	public ViewPatientPage(Patient pat, DERPBase page ) {

		setLayout(new BorderLayout());
		setPreferredSize(new Dimension(600,510));
		
		this.pat = pat;
		this.callingPage = page;
		
		userinfo = new UsersPagePanel((User)pat);
		userinfo2 = new PatientsPagePanel(pat);
		vpanel = new ViewingPatientPanel(pat, page);
		
		add(userinfo, BorderLayout.NORTH);
		add(userinfo2, BorderLayout.WEST);
		add(vpanel, BorderLayout.EAST);
		
		GUI_Main.getFrame().setTitle("Looking at Patient " + pat.getName());
		
	}
	
	public Patient getPatient()
	{
		return this.pat;
	}
	
	public DERPBase getPage()
	{
		return this.callingPage;
	}
	
	public UsersPagePanel getUserPanel()
	{
		return this.userinfo;
	}
	
	public PatientsPagePanel getPatientPanel()
	{
		return this.userinfo2;
	}
	
	public ViewingPatientPanel getViewingPanel()
	{
		return this.vpanel;
	}
	
	
	public void display()
	{
		GUI_Main.replacePanel(this);
	}

}
